/*
 * @Author: wuhao930406 1148547900@qq.com
 * @Date: 2023-07-14 13:36:06
 * @LastEditors: wuhao930406 1148547900@qq.com
 * @LastEditTime: 2023-08-02 11:39:22
 * @FilePath: /legion-iot/src/pages/system/devices/columns.js
 * @Description:
 *
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
 */
import { Image, Switch } from "antd";
import { EyeFilled } from "@ant-design/icons";

function getcolumns(enable) {
  return {
    columns: [
      {
        title: "设备编码",
        dataIndex: "code",
        key: "code",
        formItemProps: { rules: [{ required: true, message: "此项为必填项" }] },
      },
      {
        title: "设备名称",
        dataIndex: "name",
        key: "name",
        formItemProps: { rules: [{ required: true, message: "此项为必填项" }] },
      },
      {
        title: "设备类型",
        dataIndex: "device_type",
        key: "device_type",
        valueType: "select",
        options: {
          path: "/device/device_types",
          params: {},
          tlabel: "name",
          tvalue: "type",
        },
        search: false,
      },
      {
        title: "小区",
        dataIndex: "village_id",
        key: "village_id",
        valueType: "select",
        options: {
          path: "/village",
          params: { is_all: 1 },
        },
        search: false,
      },
      {
        title: "楼栋",
        dataIndex: "build_number",
        key: "build_number",
        valueType:"digit", 
        search: false,
      },
      { title: "房间号", dataIndex: "floor", key: "floor", search: false },
      { title: "经度", dataIndex: "lng", key: "lng", search: false },
      { title: "纬度", dataIndex: "lat", key: "lat", search: false },
      {
        title: "备注",
        dataIndex: "remark",
        key: "remark",
        valueType: "textarea",
        colProps: {
          span: 24,
        },
        search: false,
      },
    ],
    pathconfig: {
      enableadd: true,
      enableedit: true,
      enabledelete: true,
      enabledetail: true,
      add: "/device",
      edit: "/device",
      list: "/device",
      delete: "/device",
      detail: "",
    },
  };
}
export default getcolumns;
